package com.tongjie.hotelbooking.init;

import com.tongjie.hotelbooking.sequence.service.SequenceService;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
public class InitRunner implements ApplicationRunner {

    @Resource
    private SequenceService serialService;

    @Resource
    private InitService initService;

    @Override
    public void run(ApplicationArguments args) throws Exception {
        this.serialService.init();
        this.initService.initUserRoleAuthority();
    }
}
